home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 11 / Mac Magazin and MacEasy Magazine CD - Issue 11.iso / Sharewarebibliothek / Entwickler / appe Windows 2.0 / filter.h < prev    next >
Text File  |  1995-06-11  |  2KB  |  55 lines

  1. // File "filter.h" - 
  2.  
  3. #ifndef ____FILTER_HEADER____
  4. #define ____FILTER_HEADER____
  5.  
  6. // * ****************************************************************************** *
  7.  
  8. // Should the Inline jGNEFilter use MW's FRALLOC macros?
  9. #define ____USE_FRALLOC____
  10.  
  11. // Constant offsets into jGNEFilter for inline data
  12. #define kNextFilterOffset        0x02
  13. #define kEventHelperOffset        0x06
  14. #define kEventHelperDataOffset    0x0A
  15.  
  16. // Cleanest Solution for PPC - Stuff Raw 68k into a SystemPtr
  17. #define kGNEFilterHexData "\p600C0000000000000000000000004E56000048E7E0E0207AFFEE2008\
  18. 4A80670E2F3AFFE82F09207AFFDE4E90508F4CDF07074E5E207AFFCC4ED08B4576656E7446696C7465720000"
  19.  
  20. // Declare a Guide for Passing the Filter Helper, for Universal Headers
  21. #if !GENERATINGPOWERPC
  22. typedef void (*FilterHelperProcPtr)(EventRecord *theEvent, Ptr helperData);
  23. typedef FilterHelperProcPtr FilterHelperUPP;
  24. enum {
  25.     uppFilterHelperProcInfo = 0
  26.     };
  27. #define NewFilterHelperProc(proc)    (FilterHelperUPP)(proc)
  28. #else
  29. typedef UniversalProcPtr FilterHelperUPP;
  30. enum {
  31.     uppFilterHelperProcInfo = kCStackBased
  32.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventRecord *)))
  33.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  34.     };
  35. #define NewFilterHelperProc(proc) (FilterHelperUPP) \
  36.         NewRoutineDescriptor((ProcPtr)(proc), uppFilterHelperProcInfo, GetCurrentISA())
  37. #endif GENERATINGPOWERPC
  38.  
  39. // * ****************************************************************************** *
  40. // * ****************************************************************************** *
  41. // Function Prototypes
  42.  
  43. Ptr InstallEventFilter(FilterHelperUPP helperProc, Ptr helperData);
  44. Ptr ReleaseEventFilter(Ptr filterProc);
  45.  
  46. #if GENERATING68K
  47. asm void EventFilter(void);
  48. void EndEventFilter(void);
  49. #endif GENERATING68K
  50.  
  51. void EventFilterHelper(EventRecord *theEvent, Ptr helperData);
  52.  
  53. #endif  ____FILTER_HEADER____
  54.  
  55.